<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('user_id');
            $table->char('user_name', 10)->unique()->default('')->comment('用户名');
            $table->char('user_phone', 11)->unique()->default('')->comment('用户手机号');
            $table->char('user_password', 32)->default('')->comment('用户密码');
            $table->char('user_openid', 150)->default('')->comment('第三方登陆id');
            $table->char('user_salt', 6)->default('')->comment('用户密码加盐');
            $table->char('user_nick', 10)->unique()->default('')->comment('用户昵称');
            $table->tinyInteger('user_status')->default(1)->comment('用户状态,0为失效状态,1为正常状态,2为封号状态');
            $table->integer('regtime')->default(0)->comment('用户注册时间');
            $table->integer('last_log')->default(0)->comment('最后一次登录时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
